import request from '@/utils/request'

// 查询订单列表
export function listOrder(query) {
  return request({
    url: '/reservation/list',
    method: 'get',
    params: query
  })
}

// 查询订单
export function getOrder(reservationId) {
  return request({
    url: '/reservation/' + reservationId,
    method: 'get'
  })
}

// 新增订单
export function addOrder(data) {
  return request({
    url: '/reservation',
    method: 'post',
    data: data
  })
}

// 修改订单
export function updateOrder(data) {
  return request({
    url: '/reservation',
    method: 'put',
    data: data
  })
}
// 删除订单
export function deleteOrder(reservationId) {
  return request({
    url: '/reservation/delete/' + reservationId,
    method: 'delete'
  })
}
// 删除入住信息明细
export function delcheckinItem(reservationInformationDetailId) {
  return request({
    url: '/reservationInformationDetail/delete/' + reservationInformationDetailId,
    method: 'delete'
  })
}
// 分页查询订单列表
export function listOrderByPage(query) {
  return request({
    url: '/reservation/page',
    method: 'get',
    params: query
  })
}
// 分页查询订单明细列表
export function listOrderItemByPage(query) {
  return request({
    url: '/reservationInformationDetail/page',
    method: 'get',
    params: query
  })
}
